﻿using System.Drawing;

namespace WallpaperSharing.AppLibrary.Extensions
{
    public static class ImageExtensions
    {
        private static readonly ImageConverter IMAGE_CONVERTER = new ImageConverter();

        public static Image Resize(this Image image, Size size)
        {
            return new Bitmap(image, size);
        }

        public static byte[] ToBytes(this Image image)
        {
            return (byte[])IMAGE_CONVERTER.ConvertTo(image, typeof(byte[]));
        }
    }
}
